<?php
/**
 * класс отвечающий за отображение статистики
 *
 */
class View_Statistics{
	/**
	 * вывод статистики в виде таблицы
	 *
	 */
	public static function displayStatistics($arrStatistics){
		echo '
		<div class="box_all_info_staticstics_botton">
			<ul class="left">
				<li class="all_comemt">Комментариев: <strong>' . $arrStatistics['comment'] . '</strong></li>
				<li class="all_mark">Оценок: <strong>' . $arrStatistics['mark'] . '</strong></li>
				<li class="all_slojnost">Оценок сложности: <strong>' . $arrStatistics['difficulty'] . '</strong></li>
				<li class="all_gotov_rewen">Готовых решений: <strong>' . $arrStatistics['solution'] . '</strong></li>
				<li class="all_statia">Статей: <strong>' . $arrStatistics['article'] . '</strong></li>
			</ul>
			<ul class="right">
				<li class="all_less">Уроков: <strong>' . $arrStatistics['lesson'] . '</strong></li>
				<li class="all_otvet">Ответов: <strong>' . $arrStatistics['answer'] . '</strong></li>
				<li class="all_qwest">Вопросов: <strong>' . $arrStatistics['question'] . '</strong></li>
				<li class="all_user">Пользователей: <strong>' . $arrStatistics['user'] . '</strong></li>
				<li class="all_derevo">Разделов дерева: <strong>' . $arrStatistics['tree_section'] . '</strong></li>
			</ul>
		</div>';
	}

	public static function rightBlock($arrStatistics){
	echo '
		<h3>Статистика</h3>
		<div class="stats">
			<ul>';
				if (isset($arrStatistics['browsing_amount'])) echo '<li class="kol_prosmotr">Количество просмотров: <strong>' . $arrStatistics['browsing_amount'] . '</strong></li>';
				if (isset($arrStatistics['visitors'])) echo '<li class="prosmotrelo"> Посмотрело: <strong>' . $arrStatistics['visitors'] . '</strong></li>';
				if (isset($arrStatistics['comment_amount'])) echo '<li class="comentaruev">Комментариев: <strong>' . $arrStatistics['comment_amount'] . '</strong></li>';
				if (isset($arrStatistics['mark_amount'])) echo '<li class="ocenok">Оценок: <strong>' . ($arrStatistics['mark_amount'] ? $arrStatistics['mark_amount'] : 0) . '</strong></li>';
  echo '
			</ul>
			<a href="' . W_ABSPATH . 'statistics">Общая статистика</a>
		</div>';
	}

	/**
	 * вывод статистики на главную
	 */
	public static function showIndexStatistic($arrStatistics){
		echo '<div class="box_all_info_main">';
			echo '<div class="box_all_info_main_top">';
				echo '<div class="box_all_info_main_botton">';
					echo '<em style="font-size: 11px;">Мы запустились <strong>' . Service_Date::getCountDayPast(0, 0, 0, 6, 28, 2010) . Service_Declension::getDaysDeclension(Service_Date::getCountDayPast(0, 0, 0, 6, 28, 2010)) . '</strong> назад</em>';
					echo '<ul>';
						echo '<li class="all_comemt">Комментарии: <strong>' . (empty($arrStatistics['comment']) ? 0: $arrStatistics['comment']) . '</strong></li>';
						echo '<li class="all_statia">Статьи: <strong><a href="' . W_ABSPATH . 'articles" class="stat_link" title="">' . (empty($arrStatistics['article']) ? 0: $arrStatistics['article']) . '</a></strong></li>';
						echo '<li class="all_less">Уроки: <strong><a href="' . W_ABSPATH . 'tutorial" class="stat_link" title="">' . (empty($arrStatistics['lesson']) ? 0: $arrStatistics['lesson']) . '</a></strong></li>';
						echo '<li class="all_qwest">Вопросы: <strong><a href="' . W_ABSPATH . 'questions" class="stat_link" title="">' . (empty($arrStatistics['question']) ? 0: $arrStatistics['question']) . '</a></strong></li>';
						echo '<li class="all_user">Пользователи: <strong><a href="' . W_ABSPATH . 'userRating" class="stat_link" title="">' . (empty($arrStatistics['user']) ? 0: $arrStatistics['user']) . '</a></strong></li>';
						echo '<li class="all_gotov_rewen">Готовые решения: <strong><a href="' . W_ABSPATH . 'solutions" class="stat_link" title="">' . (empty($arrStatistics['solution']) ? 0: $arrStatistics['solution']) . '</a></strong></li>';
					echo '</ul>';
				echo '</div>';
			echo '</div>';
		echo '</div>';
	}
}
?>